Add method

Adds a recipient to the current MailRecipients collection.

Syntax

Add(Address As String, [Type As AS_MAPIMSG_RECIP_TYPE = AS_MMRT_TO], [Name As String]) As IASMailRecipient
Parameters
Name Description

Address

The email address of the recipient to add.

Type

The type of recipient as one of the AS_MAPIMSG_RECIP_TYPE constants.

Name

The name of the recipient to add.

Return Value

A MailRecipient object.

Remarks

The Name parameter should be used to specify the recipient's email address and an empty string passed to the Address parameter. If an email address is specified in Name, it must be surrounded with carets (<>). When used with Microsoft Outlook, Name parameter may contain the user's full name or last name and Outlook will attempt to resolve the name to the email address in the default address book.

Examples

oMessage.Recipients.Add “” ,AS_MMRT_TO, “<” + Document.EmailAddress + “>”
oMessage.Recipients.Add “” ,AS_MMRT_TO, “User Full Name” + “<” + Document.EmailAddress + “>”
oMessage.Recipients.Add “” ,AS_MMRT_TO, “User Last Name”

Related concepts

About the MailRecipients object

About the MailRecipient object

Related tasks

Sending email messages